// 例子30

(function () {
    //方式一
    function Person() {}

    Person.prototype.getName = function () {}
    Person.prototype.getAge = function () {}
    Person.prototype.sayHello = function () {}
})();

console.log('----------------------------------');

(function () {
    function Person() {}

    Person.prototype = {
        constructor: Person,
        getName: function () {},
        getAge: function () {},
        sayHello: function () {}
    }
})();